var domains = {
    "sfdc-esb-es.h3c.com": 0,
    "h3c.com": 1,
    "172.25.20.56": 1
};

var proxy = "PROXY middle.broqi.cn:808; DIRECT;";

var direct = 'DIRECT;';

function FindProxyForURL(url, host) {
    if (domains.hasOwnProperty(host) === 0) {
        return direct;
    }
    if (domains.hasOwnProperty(host) === 1) {
        return proxy;
    }
    var lastPos;
    do {
        if (domains.hasOwnProperty(host)) {
            return proxy;
        }
        lastPos = host.indexOf('.') + 1;
        host = host.slice(lastPos);
    } while (lastPos >= 1);
    return direct;
}